#!/bin/bash

# 安装虚拟环境
pip3 install virtualenv

## 检查当前目录是否存在虚拟环境
if [ -d "venv" ]; then
    source venv/bin/activate
else 
    virtualenv -p python3 --system-site-packages venv && source venv/bin/activate
fi

# 配置运行环境
pip3 install -r requirements.txt
## 配置 verilog-eval
cd ./eval && pip3 install -e verilog-eval
## 安装 iverilog
sudo apt-get install -y --no-install-recommends autoconf gperf flex bison screen
git clone https://githubfast.com/steveicarus/iverilog.git && cd iverilog \
        && git checkout v12-branch \
        && sh ./autoconf.sh && ./configure && make -j8\
        && make install


